<?php


# Created on: 2012-01-15 21:54:55 709

/**
* Quickly flags a single field in the tables.
*/

$administrators = new administrators();
$user_id = $variable->get('id', 'integer', 0);
$code = $variable->get('code', 'string', '');
$flag = $variable->get('flag', 'string', '');

# Assumes, ID always, in the GET parameter
if($user_id!=0 && $code!='' && $flag!='')
{
	if($administrators->flag_field($user_id, $code, $flag))
	{
		$messenger = new messenger('warning', 'The record has been successfully flagged.');

		stopper::url(url::last_page('administrators-list.php'));
	}
	else
	{
		$messenger = new messenger('error', 'The record has NOT been flagged yet. Such flag does not exist.');
		stopper::url(url::last_page('administrators-list.php?context=flagging'));
	}
}
else
{
	stopper::url('administrators-direct-access-error.php?context=flagging');
}
?>